package co.fitstart.entity.finance;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.demo2do.core.format.DecimalFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "exchange_rate")
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class ExchangeRate {
    
    @Id
    @GeneratedValue
    private Long id;
    
    @DecimalFormat(scale = 4)
    private BigDecimal exchangeRate;
    
    private Date lastUpdateTime;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * 
     */
    public ExchangeRate() {
        
    }
    
    /**
     * 
     * @param exchangeRate
     * @return
     */
    public ExchangeRate edit(BigDecimal exchangeRate) {
        this.exchangeRate = exchangeRate;
        this.lastUpdateTime = new Date();
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the exchangeRate
     */
    public BigDecimal getExchangeRate() {
        return exchangeRate;
    }

    /**
     * @return the lastUpdateTime
     */
    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param exchangeRate the exchangeRate to set
     */
    public void setExchangeRate(BigDecimal exchangeRate) {
        this.exchangeRate = exchangeRate;
    }

    /**
     * @param lastUpdateTime the lastUpdateTime to set
     */
    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
    
    

}
